package com.example.play.api

import com.example.common.api.BaseApiService
import com.example.common.entity.BaseResponse
import com.example.common.entity.CommendEntity
import com.example.common.entity.SimpleVideoEntity
import com.example.play.entity.AuthorEntity
import com.example.play.entity.DanmuEntity
import com.example.play.entity.MovieVideoEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * 播放页面的接口
 */
interface PlayApiServer:BaseApiService {
    //视频作者信息
    @GET("/videoauthor/getAuthorById")
    suspend fun getAuthorById(@Query("userid")userid:String):BaseResponse<AuthorEntity>
    //获取首页推荐视频
    @GET("/videosimple/getRecommendSimpleVideo")
    suspend fun getRecommendSimpleVideo(@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<SimpleVideoEntity>>
    //获取首页分类视频
    @GET("/videosimple/getSimpleVideoByChannelId")
    suspend fun getSimpleVideoByChannelId(@Query("channelId") channelId: String ,@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<SimpleVideoEntity>>
    //获取放映厅推荐视频
    @GET("/videomulti/getRecommendMutilVideo")
    fun getRecommendMultiVideo(@Query("page")page:Int, @Query("pagesize")pagesize:Int): BaseResponse<List<MovieVideoEntity>>
    //获取放映厅分类下视频
    @GET("/videomulti/getMutilVideoByTypeId")
    suspend fun getMultiVideoByTypeId(@Query("typeid") typeId: Int, @Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<MovieVideoEntity>>
    //获取视频评论
    @GET("/comment/getCommentByUserId")
    suspend fun getCommentByUserId(@Query("datatype") dataType: Int, @Query("itemid") itemId: String): BaseResponse<List<CommendEntity>>
    //发送评论
    @POST("/comment/publishComment")
    suspend fun publishComment(@Body body: RequestBody): BaseResponse<CommendEntity>
    //发送弹幕
    @POST("/bulletscreen/publishBulletScreen")
    suspend fun publishDanmuMsg(@Body requestBody: RequestBody): BaseResponse<String>
    //获取视频弹幕
    @GET("/bulletscreen/getBulletScreenInfo")
    suspend fun getVideoDanmuMsg(@Query("datatype") dataType: Int, @Query("itemid") itemId: String): BaseResponse<List<DanmuEntity>>


}